import request from '../utils/request';
import _fetch from '../utils/fetch';

export async function fetch(key) {
  return await request('/help', {
    params: {
      key,
      publish: 1,
    },
  });
}

export async function content(id) {
  return await request(`/help/${ id }`);
}


export function feedback(param) {
  return request('/feedback',
    {
      method: 'post',
      body: { ...param },
    },
  );
}

export function upload(body) {
  return _fetch('http://wx.hy-bang.com/consult/uploads/feedback',
    {
      method: 'post',
      body,
    },
  );
}
